package com.company;


import com.company.abs.CarFactory;
import com.company.abs.CarFactoryProducer;

/**
 * 抽象工厂方法模式代码测试
 */
public class TestForAbs {

    public static void main(String[] args) {
        //操作本田汽车
        CarFactory hondaCarFactory = CarFactoryProducer.getCarFactory("HONDA");
        //生产本田汽车
        hondaCarFactory.createProductCar().product();
        //销售本田汽车
        hondaCarFactory.createSaleCar().sale();

        //操作丰田汽车
        CarFactory toyotaCarFactory = CarFactoryProducer.getCarFactory("TOYOTA");
        //生产丰田汽车
        toyotaCarFactory.createProductCar().product();
        //销售丰田汽车
        toyotaCarFactory.createSaleCar().sale();
    }
}
